import { NestFactory } from '@nestjs/core';
import { AppModule } from './app.module';

const buildEnv = function() {
  let env = {
    "mongo_host": "118.24.98.157",
    "mongo_port": 28001,
    "mongo_db_name": "book",

    "redis_host": "118.24.98.157",
    "redis_port": 8999
  };

  let key: string;
  for (key in env) {
    process.env[key]= `${env[key]}`;
  }
};
if (process.env.OS.startsWith("Win")) {
  buildEnv();
}

(async function bootstrap() {
  const app = await NestFactory.create(AppModule);
  await app.listen(3000);
})();
